package com.hfzy.ihk.web.callhistoryold.enumType;

import java.util.HashMap;
import java.util.Map;

public enum PageFromType {

    APP_PY("0","app盘源"),

    ZY_PY("2", "置业盘源"),

    CROSS_ESTATE_APPLY("22", "申请跨区登记通话记录"),

    ADD_ESTATE_PATH("33", "新增路径通话记录"),

    APPLY_REPUT_PROPERTY("44", "重新放盘通话记录"),

    CUSTOMER_EBOOK("4", "电子客簿"),

    TAO_CUSTOMER("55", "淘客"),

    APP_CUSTOMER_EBOOK("7", "app电子客"),

    APP_LINKAGE_CALL("1", "app联动call"),

    ZY_LINKAGE_CALL("3", "置业联动call"),
    ZY_CONTINUE_FOLLOW("10", "置业联动继续跟进"),
    APP_CALL_RECORD_PHONE_FOR_LC("8", "合富置业APP联动call客通话记录"),
    APP_CALL_RECORD_PHONE_FOR_PC("9", "合富置业APP楼盘业主通话记录");

    private PageFromType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;

    public String getDesc() {
        return desc;
    }

    public String toStr() {
        return value;
    }

    private static Map<String, PageFromType> map = new HashMap<String, PageFromType>();

    static {
        for (PageFromType value : PageFromType.values())
            map.put(value.toStr(), value);
    }

    public static PageFromType fromStr(String name) {
        PageFromType ret = map.get(name);
        if (ret != null)
            return ret;
        else
            throw new IllegalArgumentException("No enum const "
                    + PageFromType.class + "." + name);
    }

    private static Map<String, PageFromType> descMap = new HashMap<String, PageFromType>();

    static {
        for (PageFromType value : PageFromType.values())
            descMap.put(value.getDesc(), value);
    }

    public static PageFromType fromDesc(String desc) {
        PageFromType ret = descMap.get(desc);
        if (ret != null)
            return ret;
        else
            throw new IllegalArgumentException("No enum const "
                    + PageFromType.class + "." + desc);
    }
}
